/*
 Navicat Premium Data Transfer

 Source Server         : lill
 Source Server Type    : MySQL
 Source Server Version : 50724
 Source Host           : 106.12.5.62:3306
 Source Schema         : seckill

 Target Server Type    : MySQL
 Target Server Version : 50724
 File Encoding         : 65001

 Date: 23/07/2019 14:38:57
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for item
-- ----------------------------
DROP TABLE IF EXISTS `item`;
CREATE TABLE `item` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `description` varchar(500) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `sales` int(11) NOT NULL DEFAULT '0',
  `img_url` varchar(2000) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='商品表';

-- ----------------------------
-- Records of item
-- ----------------------------
BEGIN;
INSERT INTO `item` VALUES (1, '汤唯', 100000.00, '女神1号', 1, 'https://img3.doubanio.com/view/photo/m/public/p642886430.webp');
INSERT INTO `item` VALUES (2, '赵丽颖', 80000.00, '女神', 2, 'https://img3.doubanio.com/view/photo/m/public/p2438271791.webp');
INSERT INTO `item` VALUES (3, 'Scarlett Johansson', 60000.00, '美国女神', 0, 'https://img3.doubanio.com/view/photo/m/public/p2526424482.webp');
INSERT INTO `item` VALUES (4, '周迅', 90000.00, '女神', 0, 'https://img3.doubanio.com/view/photo/m/public/p1328925134.webp');
COMMIT;

-- ----------------------------
-- Table structure for item_stock
-- ----------------------------
DROP TABLE IF EXISTS `item_stock`;
CREATE TABLE `item_stock` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `stock` int(11) NOT NULL DEFAULT '0',
  `item_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='商品库存表';

-- ----------------------------
-- Records of item_stock
-- ----------------------------
BEGIN;
INSERT INTO `item_stock` VALUES (1, 9, 1);
INSERT INTO `item_stock` VALUES (2, 8, 2);
INSERT INTO `item_stock` VALUES (3, 10, 3);
INSERT INTO `item_stock` VALUES (4, 10, 4);
COMMIT;

-- ----------------------------
-- Table structure for order_info
-- ----------------------------
DROP TABLE IF EXISTS `order_info`;
CREATE TABLE `order_info` (
  `id` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `user_id` int(11) NOT NULL DEFAULT '0',
  `item_id` int(11) NOT NULL DEFAULT '0',
  `item_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `amount` int(11) NOT NULL DEFAULT '0',
  `order_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `promo_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='订单表';

-- ----------------------------
-- Records of order_info
-- ----------------------------
BEGIN;
INSERT INTO `order_info` VALUES ('2019071800025000', 1, 2, 80000.00, 1, 80000.00, 0);
INSERT INTO `order_info` VALUES ('2019071800025200', 1, 2, 80000.00, 1, 80000.00, 0);
INSERT INTO `order_info` VALUES ('2019071800025400', 1, 1, 30000.00, 1, 30000.00, 1);
COMMIT;

-- ----------------------------
-- Table structure for promo
-- ----------------------------
DROP TABLE IF EXISTS `promo`;
CREATE TABLE `promo` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `promo_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `start_date` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
  `end_date` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
  `item_id` int(11) NOT NULL DEFAULT '0',
  `promo_item_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of promo
-- ----------------------------
BEGIN;
INSERT INTO `promo` VALUES (1, '赵丽颖活动', '2019-06-26 20:12:23', '2019-08-03 18:23:30', 1, 30000.00);
INSERT INTO `promo` VALUES (2, 'tangwei', '2019-06-25 23:44:00', '2019-06-27 18:23:30', 2, 10000.00);
INSERT INTO `promo` VALUES (3, 'a', '2019-06-25 23:44:00', '2019-06-24 23:44:00', 3, 20000.00);
INSERT INTO `promo` VALUES (4, 'b', '1000-01-01 00:00:00', '1000-01-01 00:00:00', 4, 100000.00);
COMMIT;

-- ----------------------------
-- Table structure for sequence_info
-- ----------------------------
DROP TABLE IF EXISTS `sequence_info`;
CREATE TABLE `sequence_info` (
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `current_value` int(11) NOT NULL DEFAULT '0',
  `step` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='顺序表';

-- ----------------------------
-- Records of sequence_info
-- ----------------------------
BEGIN;
INSERT INTO `sequence_info` VALUES ('order_info', 256, 2);
COMMIT;

-- ----------------------------
-- Table structure for stock_log
-- ----------------------------
DROP TABLE IF EXISTS `stock_log`;
CREATE TABLE `stock_log` (
  `stock_log_id` varchar(64) NOT NULL,
  `item_id` int(11) NOT NULL DEFAULT '0',
  `amount` int(11) NOT NULL DEFAULT '0',
  `status` int(11) NOT NULL DEFAULT '0' COMMENT '1表示初始状态，2表示下单扣减库存成功，3表示下单回滚',
  PRIMARY KEY (`stock_log_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of stock_log
-- ----------------------------
BEGIN;
INSERT INTO `stock_log` VALUES ('0d3e3d4672a441848eb0a2a3d9f8db8f', 2, 1, 2);
INSERT INTO `stock_log` VALUES ('3aaf399e507b432595e34ca401ea0a5b', 2, 1, 2);
INSERT INTO `stock_log` VALUES ('63100874c3bd429f8e0d849a9c53d603', 2, 1, 3);
INSERT INTO `stock_log` VALUES ('70af87a4426544afada1bf4ae1758e22', 1, 1, 2);
COMMIT;

-- ----------------------------
-- Table structure for user_info
-- ----------------------------
DROP TABLE IF EXISTS `user_info`;
CREATE TABLE `user_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(64) NOT NULL DEFAULT '' COMMENT '姓名',
  `gender` tinyint(3) NOT NULL DEFAULT '-1' COMMENT '1为男性，2为女性',
  `age` int(11) NOT NULL DEFAULT '0' COMMENT '年龄',
  `telphone` varchar(255) NOT NULL DEFAULT '' COMMENT '电话',
  `register_mode` varchar(255) NOT NULL DEFAULT '' COMMENT '来源：byphone,bywechar,byalipay',
  `third_party_id` varchar(64) NOT NULL DEFAULT '' COMMENT '第三方ID',
  PRIMARY KEY (`id`),
  UNIQUE KEY `telphone_unique_index` (`telphone`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='用户信息表';

-- ----------------------------
-- Records of user_info
-- ----------------------------
BEGIN;
INSERT INTO `user_info` VALUES (1, 'lill', 1, 12, '17621208008', 'byphone', '');
INSERT INTO `user_info` VALUES (2, 'an', 2, 18, '18501640079', 'byphone', '');
COMMIT;

-- ----------------------------
-- Table structure for user_password
-- ----------------------------
DROP TABLE IF EXISTS `user_password`;
CREATE TABLE `user_password` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `encrpt_password` varchar(128) NOT NULL DEFAULT '' COMMENT '密码',
  `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='用户密码表';

-- ----------------------------
-- Records of user_password
-- ----------------------------
BEGIN;
INSERT INTO `user_password` VALUES (1, '81DC9BDB52D04DC20036DBD8313ED055', 1);
INSERT INTO `user_password` VALUES (2, '81DC9BDB52D04DC20036DBD8313ED055', 2);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
